
function getPrizeId() {
	$('li[id^="D_"]').each(function(index, element) {
		if(element.textContent == '未公布') {
			prizeId = element.id;
			return false;
		}
	});
	if(prizeId) {
		return;
	}
	
	$('li[id^="C_"]').each(function(index, element) {
		if(element.textContent == '未公布') {
			prizeId = element.id;
			return false;
		}
	});
	if(prizeId) {
		return;
	}
	
	$('li[id^="B_"]').each(function(index, element) {
		if(element.textContent == '未公布') {
			prizeId = element.id;
			return false;
		}
	});
	if(prizeId) {
		return;
	}
	
	$('li[id^="A_"]').each(function(index, element) {
		if(element.textContent == '未公布') {
			prizeId = element.id;
			return false;
		}
	});
	if(prizeId) {
		return;
	}
}

function getWinTicket() {
	getPrizeId();
	
	Ext.Ajax.request({
		url: '/lottery/ticket_getWinTicket',
		params: {prizeId: stage + '_' + prizeId},
		success: function(response, opts) {
			var obj = Ext.decode(response.responseText);
			code = obj.code;
			
			$('#buttonStop').attr('disabled', false);			//停止按钮能够使用
		}
	});
}

